var
    s,n: string;
begin
  if edURL.Text <> '' then
  begin
    lvEventLog.Clear;
    WB_Navigate(GetCurrentWB, edURL.Text);
     // set focus to webbrowser document
    WB_SetFocus(GetCurrentWB);
  end;
      n := inttostr(sPageControl1.ActivePage.TabIndex);
  //local download directory
      NMHTTP1.Body:= getwindir+'\myfile'+n+'.png';
  //receive files
      NMHTTP1.InputFileMode:=True;
      NMHTTP1.TimeOut := 2200;
  //file to download
      s := edURL.Text;
      Delete(s,1,7);
      Delete(s,pos('/', S),300);
      edSearch.Text := s+'  '+n;
      NMHTTP1.Get('http://www.google.com/s2/favicons?domain='+s);
      if NMHTTP1.BeenTimedOut then  NMHTTP1.Free;
  //get cerren directory
      sAlphaImageList2.LoadFromFile(getwindir+'\myfile'+n+'.png');
      sPageControl1.ActivePage.ImageIndex := (strtoint(n));
